package com.czy.fx.day1.pane.borderPane;

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;

public class demo1 extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("表头");
        primaryStage.setWidth(800);
        primaryStage.setHeight(600);


        AnchorPane a1 = new AnchorPane();
        a1.setStyle("-fx-background-color: #eedc11");
        a1.setPrefWidth(100);
        a1.setPrefHeight(100);

        AnchorPane a2 = new AnchorPane();
        a2.setStyle("-fx-background-color: #27ee11");
        a2.setPrefWidth(100);
        a2.setPrefHeight(100);

        AnchorPane a3 = new AnchorPane();
        a3.setStyle("-fx-background-color: #ffffff");
        a3.setPrefWidth(100);
        a3.setPrefHeight(100);

        AnchorPane a4 = new AnchorPane();
        a4.setStyle("-fx-background-color: #ff0000");
        a4.setPrefWidth(100);
        a4.setPrefHeight(100);

        AnchorPane a5 = new AnchorPane();
        a5.setStyle("-fx-background-color: #1f1c1c");
        a5.setPrefWidth(100);
        a5.setPrefHeight(100);


        BorderPane borderPane = new BorderPane();
        borderPane.setStyle("-fx-background-color: #ff00dd");
        borderPane.setTop(a1);
        borderPane.setCenter(a2);
        borderPane.setBottom(a3);
        borderPane.setLeft(a4);
        borderPane.setRight(a5);

        borderPane.setPadding(new Insets(10));
        primaryStage.setScene(new Scene(borderPane));





        primaryStage.show();

    }
}
